import * as events from './events'

const mutations = {
  [events.CHANGE_USER_INFO]: function(state, userData) {
    state.userInfo = userData
    state.isLogin = true
  },
  [events.USER_LOGIN_MENUS]: function(state, menusData) {
    state.menusData = menusData
  },
  [events.USER_NOT_LOGIN]: function(state, code) {
    state.loginCode = code
  },
  [events.USER_LOGIN_OUT]: function(state) {
    state.userInfo = {}
    state.menusData = []
    state.isLogin = false
  }
}
export default mutations
